import { ProbeTool as BaseProbeTool } from '@cornerstonejs/tools';

// 定义一个自定义的 ProbeTool
class CustomProbeTool extends BaseProbeTool {
  // 重写 _getTextLines 方法
  _getTextLines(data, targetId) {
    const cachedVolumeStats = data.cachedStats[targetId];
    const { index, value, modalityUnit } = cachedVolumeStats;
    // 你可以根据需要修改这里的逻辑
    const textLines = [];
    const page = index[2] + 1;

    // textLines.push(`(${index[0]}, ${index[1]}, ${index[2]} + 1)`);
    textLines.push(`(${index[0]}, ${index[1]}, ${page})`);

    textLines.push(`${value.toFixed(2)} ${modalityUnit}`);

    return textLines;
  }
}

export default CustomProbeTool;
